
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using Swaf.BizObj;
using Swaf.Container;

namespace Swaf
{
	/// <summary>
	/// Summary description for SessionInfo.
	/// </summary>
	/// 
	[Serializable]
	public class SessionInfo : ISessionInfo
	{
		bool m_principalWasReset = false;
		string m_principalUserName;
		string m_principalInstanceId;
		string m_sessionId;
		bool m_isValidSession;
		INameAddressSupport m_additionalInfo;
		public SessionInfo(bool isValid, string id, string username, string instId, INameAddressSupport addInfo, bool principalWasReset)
		{
			m_isValidSession=isValid;
			m_sessionId=id;
			m_principalUserName=username;
			m_principalInstanceId=instId;
			m_additionalInfo=addInfo;
			m_principalWasReset = principalWasReset;
		}
		public SessionInfo(bool isValid, string id, string username, string instId, INameAddressSupport addInfo) 
			: this(isValid, id, username, instId, addInfo, false)
		{
		}
		
		#region ISessionInfo Members

		public string principalUserName
		{
			get
			{
				return m_principalUserName;
			}
			set
			{
				m_principalUserName=value;
			}
		}

		public string principalInstanceId
		{
			get
			{
				return m_principalInstanceId;
			}
			set
			{
				m_principalInstanceId=value;
			}
		}

		public string sessionId
		{
			get
			{
				return m_sessionId;
			}
			set
			{
				m_sessionId=value;
			}
		}

		public bool isValidSession
		{
			get
			{
				return m_isValidSession;
			}
			set
			{
				m_isValidSession=value;
			}
		}

		public INameAddressSupport additionalInfo
		{
			get
			{
				return m_additionalInfo;
			}
			set
			{
				m_additionalInfo=value;
			}
		}

		public bool principalWasReset
		{
			get { return m_principalWasReset; }
		}

		#endregion
	}
}
